

import Comfirm from "./ComfirmModal.vue";
import { createApp } from "vue";

const ComfirmPlugin = {};
ComfirmPlugin.install = function (app) {
  //1、实例化并绑定组件
  const plugin = createApp(Comfirm);
  const instance = plugin.mount(document.createElement("div"));

  //2.将挂载的Node添加到body中
  document.body.appendChild(instance.$el);

  //3、定义全局
  app.config.globalProperties.$confirm = instance;
};
export default ComfirmPlugin;
